import uvicorn
from fastapi import FastAPI, Request
from fastapi.responses import JSONResponse
from fastapi.routing import APIRoute


async def fastapi_index():
    return JSONResponse({"message": "<index>"})


async def fastapi_about():
    return JSONResponse({"message": "<about>"})


routes = [
    APIRoute(path="/fastapi/index", endpoint=fastapi_index, methods=["GET", "POST"]),
    APIRoute(path="/fastapi/about", endpoint=fastapi_about, methods=["POST"]),
]

app = FastAPI(routes=routes)


if __name__ == '__main__':
    uvicorn.run(app)